package fr.lip6.move.care.sdmaker.generator

import java.util.ArrayList

class InterfaceData {
    private String name; //the interface name
    private String interfaceID; //the computed uniq name for refer in Care
    private ArrayList<String> actorsName; //les noms des acteurs du type
    
    def InterfaceData setName(String name){
        this.name= name;
        return this
    }
    
    def addName(String actorName){
        if(actorsName == null){
            actorsName= new ArrayList<String>();
        }
        
        this.actorsName.add(actorName);
    }
    
    def InterfaceData setInterfaceID(String interfaceID){
        this.interfaceID= interfaceID;
        return this;
    }
    
    def String getName(){
        return name;
    }
    
    def String getInterfaceID(){
        return interfaceID;
    }
    
    def Boolean contains(String actorName){
        var contains= false;
        
        for(name: actorsName){
            if(name.compareTo(actorName)==0){
                contains=true;
            }
        }
        
        return contains;
    }
    
    
}
